package com.xuehu.cloud.controller;

import com.xuehu.cloud.service.PaymentFeignService2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author guoweia@cslc.com.cn
 * @createTime 2020/12/2 17:16
 * @description
 */
@Slf4j
//@RestController
public class OrderHystrixController {

    @Resource
    private PaymentFeignService2 paymentFeignService2;

    @GetMapping("/order/hystrix/feign/{id}")
    public String paymentGlobal(@PathVariable("id") Long id){
        String result = paymentFeignService2.paymentOk(id);
        return result;
    }

    @GetMapping("/order/pay/hystrix/feign/timeout/{id}")
    public String paymentTimeout(@PathVariable("id") Long id){
        String result = paymentFeignService2.paymentTimeout(id);
        log.info("***paymentTimeout-result:" + result);
        return result;
    }
}
